﻿using System.IO;
using System.Runtime.Serialization;
using System.Windows;
using Caffeine.Examples.Contacts.Repository;
using Caffeine.Examples.Contacts.ViewModel;
using Caffeine.Examples.Repository;
using Microsoft.Practices.Unity;

namespace Caffeine.Examples.Contacts.View
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            IUnityContainer container = new UnityContainer();
            container.RegisterInstance<IContactRepository>(new ContactRepository(container));
            ContactManagerViewModel viewModel = new ContactManagerViewModel(container);
            viewModel.Load();

            AddressViewModel address = new AddressViewModel(container);

            DataContext = viewModel;
            InitializeComponent();
        }

        protected override void OnRender(System.Windows.Media.DrawingContext drawingContext)
        {
            base.OnRender(drawingContext);
        }

        private void Border_MouseLeftButtonDown(System.Object sender, System.Windows.Input.MouseButtonEventArgs e)
        {
        }
    }
}
